import WangxiaoUpload from "./components/wangxiao-upload";

export default {
  data() {
    return {
      form: {
        checkThesisFile: [],
      },
    };
  },

  methods: {
    async onSubmit() {
      console.log(this.form.checkThesisFile);
      this.form.checkThesisFile.forEach(element => {
        console.log(element);
      });
    },
  },

  render(h) {
    return h("div", null, [
      h(
        "el-button",
        {
          props: { type: "primary" },
          on: { click: () => this.onSubmit("form") },
        },
        "提交资料"
      ),
      h(WangxiaoUpload, {
        props: {
          prompt:
            "支持扩展名：word文件(.doc .docx) 、 PDF文件(.pdf)、文件大小在10M内",
          value: this.form.checkThesisFile,
          suffixArray: ["pdf", "docx", "doc"],
          fileSize: 10,
          multiple: false,
          numFiles: 3,
        },
        on: {
          input: (val) => (this.form.checkThesisFile = val),
        },
      }),
    ]);
  },
};
